<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
        <button id="click">按我呀</button>
        <div id="response">

        </div>
        <script src="/static/js/jquery-1.11.0.js"></script>
        <script>
            $("#click").click(
                function () {
                    var Data = {
                        "name": "张三",
                        "csrfmiddlewaretoken": "{{ csrf_token }}"
                    };
                    console.log(Data);
                    $.ajax(
                        {
                            url: "/apd/",
                            type: "post",
                            data: Data,
                            success: function (data) {
                                $("#response").text(data["result"])
                            },
                            error: function (error) {
                                console.log(error)
                            }
                        }
                    )
                }
            )
        </script>
</body>
</html>